package org.css.service;

import org.css.dao.UserDao;
import org.css.dao.UserDaoImp;

public class UserServiceImpl implements UserService {

	public void login(String user, String password, String type) throws Exception {
		UserDao userDao = new UserDaoImp();
		String table = "admin".equalsIgnoreCase(type) ? "admin" : "student".equalsIgnoreCase(type) ? "student" : "teacher".equalsIgnoreCase("teacher") ? "teahcer" : "";
		if(table.length() == 0)
			throw new Exception("Parameter Errot: type");
		
		userDao.login(user, password, type);
	}

}
